MCS_FLAGS = -debug /r:System.Web 
ASSEMBLY_COMPILER_FLAGS =  -noconfig -codepage:utf8 -warn:4 -optimize+ -debug
CUSTOM_MCS_FLAGS = $(MCS_FLAGS) \
	-unsafe
ASSEMBLY = Banshee.LibraryWatcher.dll
SOURCES = \
	LibraryWatcherService.cs \
        AssemblyInfo.cs \
        SourceWatcher.cs

RESOURCES = \
        Banshee.LibraryWatcher.addin.xml 

REFERENCES =  \
	System \
        $(GTK_SHARP_20_LIBS) \
        Mono.Posix \
        $(BANSHEE_1_CORE_LIBS) \
        $(BANSHEE_1_THICKCLIENT_LIBS) \
        $(BANSHEE_1_SERVICES_LIBS) \
        System.Data


BUILD_REFERENCES = $(foreach ref, $(REFERENCES), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))

SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES))

RESOURCES_EXPANDED = $(addprefix $(srcdir)/, $(RESOURCES))
RESOURCES_BUILD = $(foreach resource, $(RESOURCES_EXPANDED), \
	-resource:$(resource),$(notdir $(resource)))

plugindir = $(PLUGINDIR)
plugin_SCRIPTS = $(ASSEMBLY)

all: $(ASSEMBLY)

$(ASSEMBLY): $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
	$(GMCS) $(MCS_FLAGS) $(CUSTOM_MCS_FLAGS) $(ASSEMBLY_COMPILER_FLAGS)  -out:$(ASSEMBLY) -target:library $(BANSHEE_LIBS) $(SOURCES_BUILD) $(RESOURCES_BUILD) $(BUILD_REFERENCES)

EXTRA_DIST = $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb
MAINTAINERCLEANFILES = Makefile.in

